<template>
  <div id="components-CloudTooltip-demo-placement">
    <div :style="{ marginLeft: `${buttonWidth}px`, whiteSpace: 'nowrap' }">
      <CloudTooltip placement="topLeft">
        <template slot="title">
          <span>prompt text</span>
        </template>
        <CloudButton>TL</CloudButton>
      </CloudTooltip>
      <CloudTooltip placement="top">
        <template slot="title">
          <span>prompt text</span>
        </template>
        <CloudButton>Top</CloudButton>
      </CloudTooltip>
      <CloudTooltip placement="topRight">
        <template slot="title">
          <span>prompt text</span>
        </template>
        <CloudButton>TR</CloudButton>
      </CloudTooltip>
    </div>
    <div :style="{ width: `${buttonWidth}px`, float: 'left' }">
      <CloudTooltip placement="leftTop">
        <template slot="title">
          <span>prompt text</span>
        </template>
        <CloudButton>LT</CloudButton>
      </CloudTooltip>
      <CloudTooltip placement="left">
        <template slot="title">
          <span>prompt text</span>
        </template>
        <CloudButton>Left</CloudButton>
      </CloudTooltip>
      <CloudTooltip placement="leftBottom">
        <template slot="title">
          <span>prompt text</span>
        </template>
        <CloudButton>LB</CloudButton>
      </CloudTooltip>
    </div>
    <div :style="{ width: `${buttonWidth}px`, marginLeft: `${buttonWidth * 4 + 24}px` }">
      <CloudTooltip placement="rightTop">
        <template slot="title">
          <span>prompt text</span>
        </template>
        <CloudButton>RT</CloudButton>
      </CloudTooltip>
      <CloudTooltip placement="right">
        <template slot="title">
          <span>prompt text</span>
        </template>
        <CloudButton>Right</CloudButton>
      </CloudTooltip>
      <CloudTooltip placement="rightBottom">
        <template slot="title">
          <span>prompt text</span>
        </template>
        <CloudButton>RB</CloudButton>
      </CloudTooltip>
    </div>
    <div :style="{ marginLeft: `${buttonWidth}px`, clear: 'both', whiteSpace: 'nowrap' }">
      <CloudTooltip placement="bottomLeft">
        <template slot="title">
          <span>prompt text</span>
        </template>
        <CloudButton>BL</CloudButton>
      </CloudTooltip>
      <CloudTooltip placement="bottom">
        <template slot="title">
          <span>prompt text</span>
        </template>
        <CloudButton>Bottom</CloudButton>
      </CloudTooltip>
      <CloudTooltip placement="bottomRight">
        <template slot="title">
          <span>prompt text</span>
        </template>
        <CloudButton>BR</CloudButton>
      </CloudTooltip>
    </div>
  </div>
</template>
<script>
export default {
  title: '3.位置',
  data() {
    return {
      buttonWidth: 70,
    };
  },
};
</script>
<style scoped>
#components-CloudTooltip-demo-placement .ant-btn {
  width: 70px;
  text-align: center;
  padding: 0;
  margin-right: 8px;
  margin-bottom: 8px;
}
</style>